$menu-prefix-cls: "#{$css-prefix}menu";
$menu-dropdown-item-prefix-cls: "#{$menu-prefix-cls}-horizontal .#{$menu-prefix-cls}-submenu .#{$select-dropdown-prefix-cls} .#{$menu-prefix-cls}-item";
$menu-collapse-prefix-cls: "#{$css-prefix}menu-collapse";

.#{$menu-prefix-cls} {
  display: block;
  margin: 0;
  padding: 0;
  outline: none;
  list-style: none;
  color: $text-color;
  font-size: $font-size-base;
  position: relative;

  &-horizontal{
    height: $menu-horizontal-height;
    line-height: $menu-horizontal-height;

    &.#{$menu-prefix-cls}-light{
      &:after{
        content: '';
        display: block;
        width: 100%;
        height: 1px;
        background: $border-color-base;
        position: absolute;
        bottom: $menu-horizontal-light-bottom;
        left: $menu-horizontal-light-left;
      }
    }
  }
  &-vertical{
    &.#{$menu-prefix-cls}-light{
      &:after{
        content: '';
        display: block;
        width: 1px;
        height: 100%;
        background: $border-color-base;
        position: absolute;
        top: $menu-vertical-light-top;
        bottom: $menu-vertical-light-bottom;
        right: $menu-vertical-light-right;
        z-index: 1;
      }
    }
  }
  &-verti-side{
    .#{$menu-prefix-cls}{
      .#{$menu-prefix-cls}{
        position: absolute;
        left: 100%;
        width: $menu-verti-side-width;
        top:0;
      }
    }
  }

  &-light{
    background: $menu-light-background;
  }
  &-dark{
    background:  $menu-drak-background;
  }
  &-primary{
    background: $primary-color;
  }

  &-item{
    display: block;
    outline: none;
    list-style: none;
    font-size: $font-size-base;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all $transition-time $ease-in-out;
  }
  &-item > i{
    margin-right: $menu-item-margin-right;
  }
  &-submenu-title > i, &-submenu-title span > i{
    display: inline-block;
    margin-right: $menu-submenu-title-i-margin-right;
    vertical-align: middle;
  }

  &-horizontal &-item,
  &-horizontal &-submenu
  {
    float: left;
    padding: $menu-horizontal-padding;
    position: relative;
    cursor: pointer;
    z-index: 3;
    transition: all $transition-time $ease-in-out;
  }

  &-light.#{$menu-prefix-cls}-horizontal &-item, &-light.#{$menu-prefix-cls}-horizontal &-submenu{
    height: inherit;
    line-height: inherit;
    border-bottom: 2px solid transparent;
    color: $text-color;
    &-active, &:hover{
      color: $primary-color;
      border-bottom: 2px solid $primary-color;
    }
  }

  &-dark.#{$menu-prefix-cls}-horizontal &-item, 
  &-dark.#{$menu-prefix-cls}-horizontal &-submenu{
    color: $menu-dark-subsidiary-color;
    &-active, &:hover{
      color: $menu-horizontal-item-active-color;
    }
  }
  // ----三级目录
  &-dark.#{$menu-prefix-cls}-horizontal &-submenu &-submenu{ 
      color: $text-color;
      line-height: 1;
      padding:$menu-dark-horizontal-submenu-padding;
      white-space: nowrap;
      clear:both;
      width: 100%;
  }
  &-dark.#{$menu-prefix-cls}-horizontal &-submenu &-submenu.#{$menu-prefix-cls}-active {
    color: $text-color;
  }
  &-dark.#{$menu-prefix-cls}-horizontal &-submenu &-submenu &-submenu-title-icon {
    float: right;
  }
  &-dark.#{$menu-prefix-cls}-horizontal &-submenu &-submenu .#{$select-dropdown-prefix-cls} {
      // margin-left: -16px;
       overflow-x: hidden;
  }
  // ----

  //水平模式primary主题下hover/active时超出1px【添加背景色时导致】
  &-primary.#{$menu-prefix-cls}-horizontal &-item, &-primary.#{$menu-prefix-cls}-horizontal &-submenu{
    height: $menu-horizontal-primary-item-height;
    line-height: $menu-horizontal-primary-item-height;
    color: $menu-horizontal-primary-item-color;
    &-active, &:hover{
      background: $link-active-color;
    }
  }

  &-horizontal &-submenu .#{$select-dropdown-prefix-cls} {
    min-width: 100%;
    width: auto;
    max-height: none;
    .#{$menu-prefix-cls}-item{
      height: auto;
      line-height: normal;
      border-bottom: 0;
      float: none;
    }
  }

  &-item-group{
    line-height: normal;
    &-title {
      height: $menu-item-group-title-height;
      line-height: $menu-item-group-title-height;
      padding-left: $menu-item-group-title-padding-left;
      font-size: $font-size-small;
      color: $legend-color;
    }

    & > ul{
      padding: 0 !important;
      list-style: none !important;
    }
  }

  // vertical
  &-vertical &-item,
  &-vertical &-submenu-title
  {
    padding: $menu-vertical-item-padding;
    position: relative;
    cursor: pointer;
    z-index: 1;
    transition: all $transition-time $ease-in-out;

    &:hover{
      background: $background-color-select-hover;
    }
  }

  &-vertical &-submenu-title-icon{
    position: absolute;
    right: $menu-vertical-submenu-title-icon-right;
    top: $menu-vertical-submenu-title-icon-top;
  }
  &-submenu-title-icon {
    transition: transform $transition-time $ease-in-out;
  }
  // 三级目录
  // &-opened &-submenu-title-icon{
  //   -webkit-transform: rotate(180deg);
  // }
  &-opened > &-submenu-title > &-submenu-title-icon {
    -webkit-transform: rotate(180deg);
  }
  &-vertical &-submenu &-item{
    padding-left: $menu-vertical-submenu-padding-left;
  }
  &-verti-side &-submenu &-submenu{
    position: relative;
  }
  &-verti-side &-submenu &-submenu &-submenu-title{
    padding-left:$menu-verti-side-padding-left;
  }
  &-verti-side &-submenu &-submenu &-submenu-title>&-submenu-title-icon{
    -webkit-transform: rotate(-90deg);
  }

  // 三级目录
  &-vertical &-submenu &-submenu &-item{
    padding-left: $menu-vertical-submenu-submenu-padding-left;
  }
  &-vertical &-item-group{
    &-title{
      height: $menu-vertical-title-height;
      line-height: $menu-vertical-title-height;
      font-size: $font-size-base;
      padding-left: $menu-vertical-title-padding-left;
    }
  }
  &-dark.#{$menu-prefix-cls}-vertical &-item-group{
    &-title{
        color: $text-color;
    }
  }

  &-light.#{$menu-prefix-cls}-vertical &-item{
    border-right: 2px solid transparent;
    &-active:not(.#{$menu-prefix-cls}-submenu){
      color: $primary-color;
      border-right: 2px solid $primary-color;
      z-index: 2;
    }
  }

  &-dark.#{$menu-prefix-cls}-vertical &-item, &-dark.#{$menu-prefix-cls}-vertical &-submenu-title{
    color: $menu-dark-subsidiary-color;
    &-active:not(.#{$menu-prefix-cls}-submenu),
    &-active:not(.#{$menu-prefix-cls}-submenu):hover
    {
      background: $menu-dark-active-bg;
    }
    &:hover{
      color: $menu-dark-vertical-submenu-title-hover-color;
      background: $title-color;
    }
    &-active:not(.#{$menu-prefix-cls}-submenu){
      color: $primary-color;
      border-right: 2px solid $primary-color;
    }
  }
  &-dark.#{$menu-prefix-cls}-vertical &-submenu &-item{
    &:hover{
      color: $menu-dark-vertical-submenu-title-hover-color;
      background: transparent !important;
    }
    &-active,&-active:hover{
      border-right: none;
      color: $menu-dark-vertical-submenu-title-active-color;
      background: $primary-color !important;
    }
    // 三级菜单下
    &-active.#{$menu-prefix-cls}-opened {
      background: transparent !important;
    }
  }
  &-dark,#{$menu-prefix-cls}-vertical &-item-active &-submenu-title{
    color: $menu-dark-vertical-submenu-title-color;
  }

  &-dark.#{$menu-prefix-cls}-vertical &-opened{
    background: $menu-dark-active-bg;
    .#{$menu-prefix-cls}-submenu-title{
        // background: $title-color;
        background: $menu-dark-vertical-opened-submenu-title-background;
    }
    .#{$menu-prefix-cls}{
      // background: $title-color;
      background:  $menu-dark-vertical-opened-background;
    }
    .#{$menu-prefix-cls}-submenu .#{$menu-prefix-cls}-submenu-title {
      //  background : $menu-dark-active-bg;
      background:  $menu-dark-vertical-opened-submenu-background;
    }
  }

  &-collapse {
    width: $menu-collapse;
  }
  &-collapse  &-submenu {
     position: relative; 
    
  }
  &-collapse > &-submenu > &-submenu-title {
    // padding-left: 20px;
    line-height: $menu-collapse-submenu-title-line-height;
  }
  &-collapse > &-submenu > &-submenu-title > i {
    margin: 0;
    // vertical-align: middle;
    width:$menu-collapse-submenu-title-with;
    text-align: center;
  }
  &-collapse > &-submenu > &-submenu-title > :not(.iconfont),
  &-collapse > &-submenu > &-submenu-title > &-submenu-title-icon{
    display: none;
  }
  &-collapse > &-submenu &{
    position: absolute;
    top: 0;
    left: 100%;
    z-index: 10;
    width: $menu-collapse-submenu-width;
  }

  &-collapse.#{$menu-prefix-cls}-dark > &-submenu &{
    background: $menu-collapse-dark-submenu-background;
  }
  &-collapse &-opened &-submenu-title-icon {
    -webkit-transform: rotate(0deg);
  }
  &-collapse.#{$menu-prefix-cls}-vertical.#{$menu-prefix-cls}-dark &-opened &-submenu-title {
    background: $menu-collapse-vertical-opened-submenu-title-background;
  }
}
@include select-item($menu-prefix-cls, $menu-dropdown-item-prefix-cls);

.#{$menu-dropdown-item-prefix-cls} {
  padding: $menu-horizontal-submenu-item-padding;
  font-size: $font-size-base !important;
}

/* .#{$menu-collapse-prefix-cls}.#{$menu-prefix-cls} {
  width: 64px;
  > .#{$menu-prefix-cls}-submenu-title {
    position: relative; 
    padding-left: 20px;
    > i {
      margin: 0;
      vertical-align: middle;
      width: 24px;
      text-align: center;
      line-height: 1;
    }
    > span{
      height: 0;
      width: 0;
      overflow: hidden;
      visibility: visible;
      display: inline-block;
    }
    > i.#{$menu-prefix-cls}-submenu-title-icon {
    display: none;
    }
  }
} */